import { createRouter, createWebHistory } from 'vue-router'
import Login from '../views/login/index.vue'
import Layout from '../views/layout/index.vue'
import Home from '../views/home/index.vue'
import Kind from '../views/kind/index.vue'
import SubCategory from '../views/subCategory/index.vue'
import Detail from '../views/Detail/index.vue'





const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'layout',
      component: Layout,
      children: [
        {
          path: '',
          name: 'home',
          component: Home
        },
        {
          path: 'kind/:id',
          name: 'kind',
          component: Kind
        },
        {
          path: 'kind/sub/:id',
          name: 'subCategory',
          component: SubCategory
        },
        {
          path: 'detail/:id',
          component: Detail
        }
        
      ]
    },
    
    {
      path: '/login',
      name: 'login',
      component: Login
    },
  ],
  scrollBehavior () {
    // ...
    return{
      top:0
    }
  }
})

export default router
